/*
 * @Author: intellectual-seeker 3336339701@qq.com
 * @Date: 2025-09-15 21:10:50
 * @LastEditors: intellectual-seeker 3336339701@qq.com
 * @LastEditTime: 2025-09-16 22:22:01
 * @FilePath: /code/lesson33/ThreadPool/Task.hpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef TASK_HPP
#define TASK_HPP
#include <iostream>
using namespace std;
#include <algorithm>

class Task
{
public:
    Task()
    {}

    Task(int a, int b)
        :_a(a), _b(b)
    {}

    //默认生成
    // Task(const Task& t)//拷贝构造的参数必须为const T&
    //     :_a(t._a), _b(t._b)
    // {}

    // Task& operator=(const Task& t)//赋值重载的参数必须为const T&
    // {
    //     Task tmp(t);
    //     swap(*this, tmp);

    //     return *this;
    // }

    int Execute()
    {
        return _a + _b;
    }

    int operator()()
    {
        return Execute();
    }

    void DebugToStringQuestion()
    {
        cout << "task is : " << _a << " + " << _b << " = ?" << endl;
    }

    string DebugToStringAnswer()
    {
        //cout << "answer is : " << _a << " + " << _b << " = " << _a + _b << endl;
        return to_string(_a)  + " + " + to_string(_b) + " = " + to_string(_a + _b);
    }

private:
    int _a;
    int _b;
};

#endif